import React from 'react';
import {Table, Row, Col, Form, Input, Icon, InputNumber, Radio, DatePicker, Select, Upload, Button, Switch, Modal, Popconfirm, Tabs, message} from 'antd';
import moment from 'moment'
import Constants from "../../utils/Constants";
import {downloadFile} from "../../utils/commons";

const R = require('ramda');
const TabPane = Tabs.TabPane;
const FormItem = Form.Item;
const dateFormat = 'YYYY-MM-DD';


export default Form.create({wrappedComponentRef: true})(class ApprovalList extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            disabled: true,
            type: "",
        }
    }



    columns = [
        {title: '结汇水单',  render(record) {
            return <a href="#" onClick={()=>downloadFile(Constants.FILE_MODULE[2],record.exchangeurl)}> {R.isNil(record.exchangeurl) || R.isEmpty(record.exchangeurl) ? "无" : record.exchangefilename}</a>
        }},
        {title: '收汇金额', dataIndex: 'recamount', key: 'recamount'},
        {title: '付汇人', dataIndex: 'tffi_payman', key: 'tffi_payman'},
        {title: '收汇方式', dataIndex: 'settlement', key: 'settlement'},
        {title: '收汇日期', dataIndex: 'rectime', key: 'rectime'},
        {title: '收汇币种', dataIndex: 'recamountunit', key: 'recamountunit'},
        {title: '客户汇率', dataIndex: 'cstexchangerate', key: 'cstexchangerate'},
        {title: '订单号', dataIndex: 'orderno', key: 'orderno'},
        {title: '出口金额', dataIndex: 'exportamount', key: 'exportamount'},
        {title: '本次关联金额', dataIndex: 'relateamount', key: 'relateamount'},
        {title: '外汇备注', dataIndex: 'tffi_memo', key: 'tffi_memo'},
    ];


    render() {
        let dataSource = R.isNil(this.props.dataSource) ? {} : this.props.dataSource;
        return (
            <div>
                <Table dataSource={this.props.forexs} columns={this.columns} bordered={true} size={'middle'}  scroll={{ x: true }}/>
            </div>

        );
    }
})


